<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>OA协同办公系统</title>
		<link href="css/table.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
		<script type="text/javascript" src="js/openwindow.js"></script>
		<script type="text/javascript" src="js/table.js"></script>
		<script type="text/javascript">
function page(currentPage){
		$("#page").val(currentPage);
		document.pageForm.submit();
	}
	function taskNewEnd(taskId){
		var url="taskNewEnd.action?taskId="+taskId;
		openWindow(url,804,604);
	}
	
function tasknotify(val){
	if(val=='not'){
		window.location.href="notifyTaskList.action";
	}else{
		window.location.href="setNotifyList.action";
	}
}	
</script>
	</head>
	<body>

		<table align="center" border="0" cellpadding="0" cellspacing="0"
			width="98%">
			<tbody>
				<tr>
					<td style="background: url('image/wsoa_window_002.gif');" width="1"></td>
					<td style="background: url('image/wsoa_window_002.gif');">
						<table border="0" cellpadding="0" cellspacing="0">
							<tbody>
								<tr>
									<td align="center"
										style="background: url('image/wsoa_window_002.gif');"
										width="10">
										<img src="image/center_19.gif">
									</td>
									<td align="center"
										style="background: url('image/wsoa_window_002.gif');"></td>
									<td>
										个人日程
									</td>
								</tr>
							</tbody>
						</table>
					</td>
					<td style="background: url('image/wsoa_window_002.gif');" width="1"></td>
				</tr>
				<tr>
					<td style="background: url('image/wsoa_window_010.gif');" width="1">
						&nbsp;
					</td>
					<td>
						<dir style="margin-top: 10px">
						</dir>
						<table style="margin-top: 10px" id="tabllist" class="righ_list"
							frame="box" cellspacing="1" cellpadding="0" width="100%"
							border="0">
							<tr align="center" class="reigh_list2">
								<td>
									日程主题
								</td>
								<td width="10%">
									建立人
								</td>
								<td width="10%">
									日程状态
								</td>
								<td width="10%">
									创建日期
								</td>
							</tr>
							<c:if test="${empty tasks}">
								<tr id="row">
									<td colspan="4">
										没有相关的记录！
									</td>
								</tr>
							</c:if>
							<c:set var="date"><fmt:formatDate value="${date}" pattern="yyyy-MM-dd" /></c:set>
							<c:forEach items="${tasks}" var="task">
							<c:set var="startDate"><fmt:formatDate value="${task.startTime}" pattern="yyyy-MM-dd" /></c:set>
							<c:set var="endDate"><fmt:formatDate value="${task.endTime}" pattern="yyyy-MM-dd" /></c:set>
								<tr id="row" onmouseover="overStyle(this)"
									onmouseout="outStyle(this)">
									<td>
										<c:choose>
										<c:when test="${date>endDate}">
											<a href="javascript:taskNewEnd('${task.id }')"> <font
												style="text-decoration: line-through">${fn:substring(task.title,0,25 )
													}</font> </a>
										</c:when>
										<c:otherwise>
											<a href="javascript:taskNew('${task.id }')">
												${fn:substring(task.title,0,25 )} </a>
										</c:otherwise>
									</c:choose>
									</td>
									<td>
										${task.userName }
									</td>
									<td>
										<c:if test="${date<startDate}">
										未开始
										</c:if>
										<c:if test="${startDate<=date&&date<=endDate}">
										办理中
										</c:if>
										<c:if test="${date>endDate}">
										已结束
										</c:if>
									</td>
									<td>
										<fmt:formatDate value="${task.creationTime}" type="date"
											pattern="yyyy-MM-dd" />
									</td>
								</tr>
							</c:forEach>
						</table>

					</td>
					<td style="background: url('image/wsoa_window_006.gif');" width="1">
						&nbsp;
					</td>
				</tr>
				<tr>
					<td height="1" width="1">
						<img src="image/wsoa_window_009.gif" height="16" width="14">
					</td>
					<td style="background: url('image/wsoa_window_008.gif');"
						height="1"></td>
					<td height="1" width="1">
						<img src="image/wsoa_window_007.gif" height="16" width="12">
					</td>
				</tr>
			</tbody>
		</table>
		<div style="float: right; margin-right: 20px">
			<form action="doSearch.action" name="pageForm" method="post">
				<input type="hidden" name="startDate" value="${startDate}" />
				<input type="hidden" name="endDate" value="${endDate}" />
				<input type="hidden" id="page" name="currentPage" />
				<input type="hidden" name="searchDTO.entityName"
					value="${searchDTO.entityName }" />
				<c:forEach items="${searchDTO.columnNames}" var="column">
					<input type="hidden" name="searchDTO.columnNames"
						value="${column }" />
				</c:forEach>
				<input type="hidden" name="searchDTO.searchContent"
					value="${searchDTO.searchContent }" />
				<%@include file="../page/page.jsp"%>
			</form>
		</div>
	</body>
</html>